This invention relates to a color image processing method and apparatus and, more particularly, to a color image processing method and apparatus capable of coding and storing color image data.
A conventional highly efficient compression coding scheme that is well known and developed for the international standardization is, the JPEG scheme (The Journal of the Institute of Image Electronics Engineers of Japan, Vol. 20, No. 1, 1991, pp. 50-58).
FIG. 9 is a block diagram illustrating a general processing procedure of the JPEG scheme.
In the JPEG scheme, first, input image data is subject to sampling, and divided into 8xc3x978 pixel-blocks. Subsequently, each block is subject to a two dimensional discrete cosine transform (hereinafter, referred to as xe2x80x9cDCTxe2x80x9d) (8xc3x978 DCT 62 in FIG. 9). The obtained 8xc3x978 DCT coefficients are subject to linear quantization at the step size based on the position of each coefficient with reference to a quantization table (8xc3x978 coefficients) (Linear quantization 63 in FIG. 9). Finally, the quantized DCT coefficients are subjected to a Huffman transform. That is, on the DC coefficient, the difference with the DC coefficient of the preceding block is calculated. On the other hand, a zigzag-scan on the AC coefficients is performed to convert the two-dimensional values into one-dimensional values, an entropy coding (two dimensional coding) is performed by a pair of the run length of the zero coefficient and non-zero coefficient (Entropy coding 64 in FIG. 9), and the obtained code is output as coded data.
When the input image data is expressed in a color space (A, B, C), various expressing manners are provided for each color component. For example, pixels of each color component can be expressed as follows:
(1) When each of A, B, C components is composed of Xxc3x97Y pixels,
[No sub-sampling]; refer to FIGS. 10A-10C.
(2) When the A component is composed of Xxc3x97Y pixels, and each of the B and C components are composed of (X/2)xc3x97Y pixels, on which xc2xd sub-sampling is performed in the horizontal (X) direction,
[Sub-sampling ratio: A:B:C=4:2:2], refer to FIGS. 11A-11C.
(3) when the A component is composed of Xxc3x97Y pixels, and each of the B and C components are composed of (X/2)xc3x97(Y/2) pixels, on which the xc2xd sub-sampling is performed both in the horizontal (X) and vertical (Y) directions,
[Sub-sampling ratio: A:B:C=4:1:1], refer to FIGS. 12A-12C.
Sub-sampling is performed by using an arbitrary sub-sampling ratio in the above (Sub-sampling 61 in FIG. 9), and then, the process following the DCT is performed.
When the sub-sampling ratio is 4:2:2 (FIGS. 11A-11C), four blocks of the A component, two blocks of the B component and two blocks of the C component correspond to the same image area, respectively. If the B and C components do not severely effect the visual image, a more efficient coding can be performed by changing the sub-sampling ratio to A:B:C=4:1:1.
In the prior art, when the sub-sampling is performed in consideration of a visual characteristic, efficient coding can be performed on an overall image. However, a negative influence such as a partial image deterioration may result.
For example, when the color space of the input image data is YCbCr and the sub-sampling ratio is Y:Cb:Cr=4:1:1, if the data which is coded after the sub-sampling is decoded, a problem arises in that deterioration of image quality becomes great in more important portions of color information, such as a color character portion, in comparison with the portion of the monochromatic character and the natural picture image portions. Another problem is such that efficiency in coding color image data which includes a black/white portion is not so good if a color image coding scheme is applied to both the color and black/white portions.
Accordingly, it is an object of the present invention to provide a color image processing apparatus capable of compressing an image by efficiently coding the image in which image deterioration is suppressed by utilizing advantages of sub-sampling.
According to the present invention, the foregoing object is attained by a color image processing apparatus comprising: input means for inputting color image data; discrimination means for dividing the color image data input by the input means into a plurality of blocks, and discriminating whether or not each of the plurality of blocks is a block having a predetermined color characteristic; sampling means for sampling the color image data included in each of the plurality blocks by changing the sampling rate; and first coding means for coding the color image data which are sampled by the sampling means.
It is another object of the present invention to provide a color image processing method capable of efficiently coding an image in which image deterioration is suppressed by utilizing advantages of sub-sampling.
According to the present invention, the foregoing object is attained by a color image processing method comprising: an input step for inputting color image data; a discrimination step for dividing the color image data input by the input step into a plurality of blocks, and discriminating whether or not each of the plurality of blocks having a predetermined color characteristic; a sampling step for sampling the color image data included in each of the plurality of blocks by changing the sampling rate; and a coding step for coding the color image data which are sampled by the sampling step.
In accordance with the present invention as described above, before the coding of color image data, the input color image data is divided into a plurality of blocks, whether or not each block is a block having a predetermined characteristic is discriminated, the sampling rate is changed based on the discrimination result, and a sampling is performed on the color image data included in the block.
It is another object of the present invention to provide a color image processing apparatus capable of compressing an image by efficiently coding the image in which the deterioration is suppressed in accordance with he type of the block input image.
According to the present invention, the foregoing object is attained by a color image processing apparatus comprising: input means for inputting color image data; discrimination means for dividing the color image data input by the input means into a plurality of blocks, and discriminating whether each of the plurality of blocks is a block expressing a multichromatic image or a monochromatic image; and first coding means for coding the color image data based on the discrimination result by the discrimination means.
It is another object of the present invention to provide a color image processing method capable of efficiently coding an image in which the image deterioration is suppressed in accordance with the type of the block input image.
According to the present invention, the foregoing object is attained by a color image processing method comprising: an input step for inputting color image data; a discrimination step for dividing the color image data input by the input step into a plurality of blocks, and discriminating whether each of the plurality of blocks is a block expressing a multichromatic image or a monochromatic image; a first coding step for coding the color image data based on the result of the discrimination step.
The invention is particularly advantageous since coded data in which deterioration of image quality is suppressed can be obtained in consideration with the color characteristic of the image, since before the coding of color image data, the input color image data is divided into a plurality of blocks, whether or not each block is a block having a predetermined characteristic is discriminated, the sampling rate is changed based on the discrimination result, and a sampling is performed on the pixels included in the block.
Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof.